<template>
  <div class="scheduling">
    <div>
      <el-form class="oldIndent_nav" ref="dataForm">
        <div style="margin-bottom:20px;padding-top:10px;">
          <span style="margin-left:60px">院区：</span>
          <el-input placeholder="请输入院区" style="width:200px"></el-input>
          <span style="margin-left:50px">开始时间:</span>
          <el-date-picker
            type="date"
            placeholder="选择时间"
            format="yyyy 年 MM 月 dd 日"
            :picker-options="pickerOptions0"
            value-format="yyyyMMdd"
          ></el-date-picker>
          <span style="margin-left:50px">结束时间:</span>
          <el-date-picker
            type="date"
            placeholder="选择时间"
            format="yyyy 年 MM 月 dd 日"
            :picker-options="pickerOptions0"
            value-format="yyyyMMdd"
          ></el-date-picker>
          <el-button type="primary" round style="float:right;margin-right:200px">查询</el-button>
        </div>
      </el-form>
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column prop="time" align="center" label="日期"></el-table-column>
        <el-table-column prop="id" align="center" label="排班编号"></el-table-column>
        <el-table-column prop="schType" align="center" label="挂号类别"></el-table-column>
        <el-table-column prop="type" align="center" label="时间段"></el-table-column>
        <el-table-column prop="price" align="center" label="挂号费用"></el-table-column>
        <el-table-column prop="depCode" align="center" label="科室编号"></el-table-column>
        <el-table-column prop="docCode" align="center" label="医师编号"></el-table-column>
        <el-table-column prop="dzInfo" align="center" label="导诊信息"></el-table-column>
        <el-table-column label="操作" align="center">
          <template slot-scope="scope">
            <el-button size="mini" type="success" @click="handleClick(scope.row)">查看详情</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <!-- 分页 -->
    <el-col :span="24" class="toolbar" style="text-align: center;">
      <el-pagination
        background
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-count="pageNum"
        :page-size="pagesize"
        style="margin-top:30px;margin-bottom:30px"
        layout="total, prev, pager, next, jumper"
        :total="total"
      ></el-pagination>
    </el-col>
  </div>
</template>
<script>
export default {
  data() {
    return {
      currentPage: 1, // 初始页
      pagesize: 10, // 当前页面内的列表行数
      pageCount: 1,
      pageNum: 1, //页数
      total: 4,
      pickerOptions0: {
        disabledDate(time) {
          return time.getTime() < Date.now() - 8.64e7;
        }
      },
      tableData: [
        {
          time: "2019-12-01",
          id: "15645231231",
          schType: "专家",
          type: "上午",
          price: "200元",
          depCode: "156122",
          docCode: "2315123",
          dzInfo: "头部轻微中风"
        },
        {
          time: "2019-12-03",
          id: "564561212",
          schType: "普通",
          type: "下午",
          price: "150元",
          depCode: "654561",
          docCode: "84512",
          dzInfo: "牙痛，淋巴结发炎"
        },
        {
          time: "2019-12-03",
          id: "7854123123",
          schType: "专家",
          type: "下午",
          price: "200元",
          depCode: "4561212",
          docCode: "486412311",
          dzInfo: "轻微性骨折"
        },
        {
          time: "2019-12-06",
          id: "785112321",
          schType: "专家",
          type: "上午",
          price: "230元",
          depCode: "7561222",
          docCode: "415123",
          dzInfo: "痔疮"
        }
      ]
    };
  },
  methods: {
    handleClick(row) {
      this.$router.push({ name: "排班信息详情", params: { data: row } });
    },
    //当前页
    handleSizeChange: function(pagesize) {
      this.pagesize = pagesize;
    },
    // 换页：更新列表数据
    handleCurrentChange: function(currentPage) {
      this.currentPage = currentPage;
    }
  },
  mounted() {}
};
</script>
<style lang="scss" scoped>
.scheduling {
  margin-top: 55px;
}
</style>